package com.iRomantic.controller.manager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.iRomantic.common.BaseController;
import com.iRomantic.controller.app.UserAPPController;
import com.jfinal.ext.route.ControllerBind;

public class ManagerController extends BaseController {
	
	private static final Logger logger = LoggerFactory.getLogger(ManagerController.class);
	
	/**
	 * 默认
	 */
	public void index(){
		//renderWebJsp("portal/index.jsp");
		renderWebJsp("manager/login.jsp");
	}
	
	public void contact(){
		renderWebJsp("portal/contact.jsp");
	}
	
	public void agreement(){
		renderWebJsp("portal/agreement.jsp");
	}
	
	public void gdcainfo(){
		this.redirect("http://gdcainfo.miitbeian.gov.cn/publish/query/indexFirst.action");
	}
	
	public void test(){
		renderWebJsp("test.jsp");
	}
	
	public void login(){
		String username = this.getPara("username");
		String password = this.getPara("password");
		String tips = null;
		
		if(null!=username && null!=password && "admin".equals(username.toString()) && ",.iromantic2013".equals(password.toString())){
			logger.info("登录成功");
			//成功
			//renderWebJsp("test.jsp");
			renderWebJsp("manager/main.jsp");
		}else{
			logger.info("登录失败");
			tips = "账号或密码错误";
			this.setAttr("tips", tips);
			this.setAttr("username", username);
			this.setAttr("password", password);
			renderWebJsp("manager/login.jsp");
		}
	}
	
	

}
